GtkListBox: Remove refilter signal
authorAlexander Larsson <alexl@redhat.com>
Tue, 11 Jun 2013 11:56:38 +0000 (13:56 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 13 Jun 2013 10:17:07 +0000 (12:17 +0200)
This was added from https://bugzilla.gnome.org/show_bug.cgi?id=691979
where it was wanted in order to get a "all children filtered" kind
of row. However, the solution is not really generic enough, because
filtering can happen for other reasons than a full refilter (i.e. due
to a row change), and the partial fix you can get by counting children
after refilter can be achieved by manually doing it whenever you manually
called refilter anyway.

Its possible we should have some better solution for the "empty state"
though.

gtk/gtklistbox.c
gtk/gtklistbox.h

index 62598b3047a7087fcda5839871424e26918339b3..37e956be73c056c302093d8926413ed4f9d4e4a8 100644 (file)
@@ -96,7 +96,6 @@ enum {
   ACTIVATE_CURSOR_ROW,
   TOGGLE_CURSOR_ROW,
   MOVE_CURSOR,
-  REFILTER,
   LAST_SIGNAL
 };
 
@@ -175,7 +174,6 @@ static void                 gtk_list_box_real_toggle_cursor_row       (GtkListBo
 static void                 gtk_list_box_real_move_cursor             (GtkListBox          *list_box,
                                                                        GtkMovementStep      step,
                                                                        gint                 count);
-static void                 gtk_list_box_real_refilter                (GtkListBox          *list_box);
 static void                 gtk_list_box_finalize                     (GObject             *obj);
 static void                 gtk_list_box_real_parent_set              (GtkWidget           *widget,
                                                                        GtkWidget           *prev_parent);
@@ -337,7 +335,6 @@ gtk_list_box_class_init (GtkListBoxClass *klass)
   klass->activate_cursor_row = gtk_list_box_real_activate_cursor_row;
   klass->toggle_cursor_row = gtk_list_box_real_toggle_cursor_row;
   klass->move_cursor = gtk_list_box_real_move_cursor;
-  klass->refilter = gtk_list_box_real_refilter;
 
   properties[PROP_SELECTION_MODE] =
     g_param_spec_enum ("selection-mode",
@@ -419,14 +416,6 @@ gtk_list_box_class_init (GtkListBoxClass *klass)
                   _gtk_marshal_VOID__ENUM_INT,
                   G_TYPE_NONE, 2,
                   GTK_TYPE_MOVEMENT_STEP, G_TYPE_INT);
-  signals[REFILTER] =
-    g_signal_new ("refilter",
-                  GTK_TYPE_LIST_BOX,
-                  G_SIGNAL_RUN_LAST,
-                  G_STRUCT_OFFSET (GtkListBoxClass, refilter),
-                  NULL, NULL,
-                  g_cclosure_marshal_VOID__VOID,
-                  G_TYPE_NONE, 0);
 
   widget_class->activate_signal = signals[ACTIVATE_CURSOR_ROW];
 
@@ -771,14 +760,6 @@ gtk_list_box_set_separator_func (GtkListBox *list_box,
   gtk_list_box_reseparate (list_box);
 }
 
-static void
-gtk_list_box_real_refilter (GtkListBox *list_box)
-{
-  gtk_list_box_apply_filter_all (list_box);
-  gtk_list_box_reseparate (list_box);
-  gtk_widget_queue_resize (GTK_WIDGET (list_box));
-}
-
 /**
  * gtk_list_box_refilter:
  * @list_box: a #GtkListBox
@@ -796,7 +777,9 @@ gtk_list_box_refilter (GtkListBox *list_box)
 {
   g_return_if_fail (list_box != NULL);
 
-  g_signal_emit (list_box, signals[REFILTER], 0);
+  gtk_list_box_apply_filter_all (list_box);
+  gtk_list_box_reseparate (list_box);
+  gtk_widget_queue_resize (GTK_WIDGET (list_box));
 }
 
 static gint
index df38082b060fbf08bc961f46e03d7322c9d6b7bd..ee49e0818261ef2d8a18223bbac8bb4dd1cfcb28 100644 (file)
@@ -62,7 +62,6 @@ struct _GtkListBoxClass
   void (*activate_cursor_row) (GtkListBox* list_box);
   void (*toggle_cursor_row) (GtkListBox* list_box);
   void (*move_cursor) (GtkListBox* list_box, GtkMovementStep step, gint count);
-  void (*refilter) (GtkListBox* list_box);
 
   /* Padding for future expansion */
   void (*_gtk_reserved1) (void);